<blockquote class="layui-elem-quote">
  网站基本信息
</blockquote>

<div class="layui-btn-container mt15 mb15">

  <form class="layui-form" action="">

    <div class="layui-form-item">
      <label class="layui-form-label">网站图标</label>
      <div class="layui-input-block">
        <input type="text" name="logo" value="{$webconfig.logo}" placeholder="网站图标" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">网站名称</label>
      <div class="layui-input-block">
        <input type="text" name="webname" value="{$webconfig.webname}" placeholder="网站名称" autocomplete="off" class="layui-input">
      </div>
    </div>
    

    <div class="layui-form-item">
      <label class="layui-form-label">网站地址</label>
      <div class="layui-input-block">
        <input type="text" name="siteurl" value="{$webconfig.siteurl}" placeholder="网站地址" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">copyright</label>
      <div class="layui-input-block">
        <input type="text" name="copyright" value="{$webconfig.copyright}" placeholder="2022-2024" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">ICP</label>
      <div class="layui-input-block">
        <input type="text" name="icp" value="{$webconfig.icp}" placeholder="备案号" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">ICP链接</label>
      <div class="layui-input-block">
        <input type="text" name="icp_url" value="{$webconfig.icp_url}" placeholder="ICP链接" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">SEO标题</label>
      <div class="layui-input-block">
        <input type="text" name="seo_title" value="{$webconfig.seo_title}" placeholder="SEO标题" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">首页关键词</label>
      <div class="layui-input-block">
        <textarea name="seo_keywords" placeholder="首页描述" class="layui-textarea">{$webconfig.seo_keywords}</textarea>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">首页描述</label>
      <div class="layui-input-block">
        <textarea name="seo_description" placeholder="首页描述" class="layui-textarea">{$webconfig.seo_description}</textarea>
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">公司地址</label>
      <div class="layui-input-block">
        <input type="text" name="address" value="{$webconfig.address}" placeholder="公司地址" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">公司名称</label>
      <div class="layui-input-block">
        <input type="text" name="name" value="{$webconfig.name}" placeholder="公司名称" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">联系方式</label>
      <div class="layui-input-block">
        <input type="text" name="phone" value="{$webconfig.phone}" placeholder="联系方式" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">QQ</label>
      <div class="layui-input-block">
        <input type="text" name="qq" value="{$webconfig.qq}" placeholder="qq" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">微信号</label>
      <div class="layui-input-block">
        <input type="text" name="weixin" value="{$webconfig.weixin}" placeholder="微信号" autocomplete="off" class="layui-input">
      </div>
    </div>

    <div class="layui-form-item">
      <label class="layui-form-label">邮箱</label>
      <div class="layui-input-block">
        <input type="text" name="email" value="{$webconfig.email}"  placeholder="邮箱" autocomplete="off" class="layui-input">
      </div>
    </div>




    <div class="layui-form-item">
      <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit lay-filter="configbtn">立即提交</button>
        <!-- <button type="reset" class="layui-btn layui-btn-primary">重置</button> -->
      </div>
    </div>


  </form>
    
</div>

<script>
  layui.use(['form', 'laydate', 'util'], function(){
    var form = layui.form;
    var layer = layui.layer;

    
    // 提交事件
    form.on('submit(configbtn)', function(data){
      var field = data.field; // 获取表单字段值

      $.post("{:url('web.config/index')}",field,function(res){
        console.log(res)
        if(res.code==1){
          layer.msg("更新成功")
        }else{
          layer.msg("更新失败")
        }
      })


      return false; // 阻止默认 form 跳转
    });
    






  });
  </script>